<?php
require(dirname(__FILE__)."/includes/init.php");
/*
1, 表示雅虎
2, 表示GMAIL
3, 表示HOTMAIL
4, 表示testsend
5, 表示AOL
6, 表示VERIFY
7, 表示others
*/
$type = 52;

$sql = "select * from tempTemplate where type = ".$type." and flag = 0 limit 0,$num";
$result = $GLOBALS['db']->dbfetchAll($sql);
if(empty($result)){exit;}
$timeStr = time();
$hostArr = array();
foreach ($result as $key => $value) {
	$j = getSendServer($type);
    $hostArr = $serverArr[$j];
  //  print_r($hostArr);exit;
   send_simple_message($value['address'], $value['title'], $value['content'], $value['id'], $hostArr);
   sendEmailLog($j, $type);
//  send_simple_message("freshrich@163.com",$template['title'],$template['content'],$value['id'],$hostArr);
   $sql = "update tempTemplate set flag = 1, timeStamps = ".$timeStr." where id = ".$value['id'];
   $GLOBALS['db']->dbquery($sql);

}



?>
